﻿<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link rel="stylesheet" type="text/css" media="screen" href="css/redmond/jquery-ui-1.10.3.custom.min.css" />	<!-- jqueryUI CSS -->
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />							<!-- jqGrid CSS -->
<link rel="stylesheet" type="text/css" media="screen" href="css/selfTemplate.css" />						<!-- 本專案自行定義 CSS -->

<script src="js/jquery-1.10.2.min.js"></script>		<!-- jQuery 核心 -->
<script src="js/grid.locale-tw.js" type="text/javascript"></script>											<!-- jqGrid 語系檔 -->
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>										<!-- jqGrid 核心 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>							<!-- jqueryUI 核心 -->
<script src="js/jquery.cookie.js" type="text/javascript"></script>																<!-- 操作cookie用 -->
<script src="js/widgets.js" type="text/javascript"></script>							<!-- jqueryUI 核心 -->

<title>維護Squad</title>

<script type="text/javascript">

$(document).ready(function() {
	
	init("squad.html");
	windowFreeze("畫面初始中");
	
	/*	綁定 下拉吧 選擇的事件 */ 
	selectSubSys("QuerySquad");
	
	$("#gd").jqGrid({
		url: "QuerySquad",
		datatype: "json",
		type: "post",
		postData: { subsysId:"fOrder" },
	   	colNames:["SQUAD ID","部署路徑"],
	   	colModel:[
	   		{	/*	資源群組ID	*/
	   			name:"squadId",
	   			index:"squadId",
	   			editable:true,
	   			editrules:{
	   				required:true
	   			}
	   		},
	   		{	/*	部署路徑	*/
	   			name:"squadPath",
	   			index:"squadPath",
	   			editable:true
	   		}
	   	],
	   	rowNum: 6,
	   	pager: "#pager",
	   	forceFit: true,
		rownumbers: true,
	   	viewrecords: true,	
	}).jqGrid("navGrid","#pager",{add:true,edit:true,del:true,search:false,refresh:false},
		{	
			/* Edit
				按下送出後要完成下列功能
				1. 畫面更新為新輸入的資料
				2. 後端更改新值成功 
			*/
			url: "ManipulateGridSquad",
			mtype: "POST",
			editData:{ 
				subsysId:"fOrder",
				empId:$.cookie("empId")
			}		
		},
		{	// Add
			url: "ManipulateGridSquad",
			mtype: "POST",
			editData: {
				subsysId:"fOrder",
				empId:$.cookie("empId")
			}
		},
		{	// Delete
			url: "ManipulateGridSquad",
			mtype: "POST",
			delData: { 
				squadId: function() {
					var sel_id = $("#gd").jqGrid('getGridParam', 'selrow');
					return $("#gd").jqGrid('getCell', sel_id, 'squadId');
				},
				subsysId:"fOrder",
				empId:$.cookie("empId")
			}
		});
	
		//reconfigPermissions('2','gd');
		
		windowUnfreeze();
}).tooltip();
</script>

</head>
<body>
	<div id="header"></div>
	<p>
	<img src="pic/Squad.png" >
	<p>
	<table id="gd"></table>
	<div id="pager"></div>


</body>
</html>